<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">

    <!-- INTERFACE -->
    <cc:interface>
        <cc:attribute name="value"/>
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>
        <p:autoComplete completeMethod="#{institutionController.completeBankBranch}" 
                        var="dept" id="branch"
                        itemLabel="#{dept.name}"
                        itemValue="#{dept}"
                        forceSelection="true" 
                        value="#{cc.attrs.value}" 
                        converter="institutionConverter" >
            <p:column headerText="Name">
                <h:outputLabel value="#{dept.name}"/>
            </p:column>
            <p:column headerText="Banck">
                <h:outputLabel value="#{dept.institution.name}"/>
            </p:column>
            <p:column headerText="Code">
                <h:outputLabel value="#{dept.institutionCode}"/>
            </p:column>
        </p:autoComplete>
        <p:watermark for="branch" value="Branch(Bank)"/>
    </cc:implementation>
</html>